<?php echo $this->fetch('header.html'); ?>
<script type="text/javascript" src="<?php echo $this->res_base . "/" . 'js/jquery.vtip.js'; ?>" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
    $('.checkitem').attr('checked', false);//用于删除时返回复选框全部取消
});
</script>
<style type="text/css">
.width_nowrap {width:140px;height:18px;line-height:18px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
</style>
<div id="rightTop">
  <ul class="subnav">
    <li><a class="btn0" href="index.php?app=kd_yubao">预报记录</a></li>
    <li><a class="btn1" href="index.php?app=kd_yubao&act=add">到货预报</a></li>
    <li><a class="btn1" href="index.php?app=kd_yubao&act=ruku">快速入库</a></li>
  </ul>
</div>
<div class="mrightTop">
    <div class="fontl">
<form method="get">
 <div class="left">
    <input type="hidden" name="app" value="kd_yubao" />
    仓库：<select name="cangku" id="cangku" class="select_class">
    <option value="0">=请选择=</option>
    <?php $_from = $this->_var['category']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['list']):
?>
    <option value="<?php echo $this->_var['list']['cate_name']; ?>" <?php if ($_GET['cangku'] == $this->_var['list']['cate_name']): ?>selected="selected"<?php endif; ?>><?php echo $this->_var['list']['cate_name']; ?></option>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>&nbsp;&nbsp;
    状态：<select name="status">
	<option value="-1">=请选择=</option>
	<option value="0" <?php if ($_GET['status'] == '0'): ?>selected="selected"<?php endif; ?>>未入库</option>
    <option value="1" <?php if ($_GET['status'] == '1'): ?>selected="selected"<?php endif; ?>>已入库</option>
	<option value="2" <?php if ($_GET['status'] == '2'): ?>selected="selected"<?php endif; ?>>已发出</option>
    <option value="3" <?php if ($_GET['status'] == '3'): ?>selected="selected"<?php endif; ?>>转仓件</option>
    <option value="4" <?php if ($_GET['status'] == '4'): ?>selected="selected"<?php endif; ?>>问题件</option> 
    <option value="5" <?php if ($_GET['status'] == '5'): ?>selected="selected"<?php endif; ?>>待认领</option>
    <option value="6" <?php if ($_GET['status'] == '6'): ?>selected="selected"<?php endif; ?>>已取消</option>   
	</select>&nbsp;&nbsp;
    关键词:<input class="queryInput" type="text" name="key" value="<?php echo htmlspecialchars($_GET['key']); ?>" style="width:230px" placeholder="商品名称、包裹运单号"/>&nbsp;&nbsp;
    添加时间：<input type="text" value="<?php echo $_GET['add_time_from']; ?>" id="add_time_from" name="add_time_from" class="pick_date" /> 至
    <input type="text" value="<?php echo $_GET['add_time_to']; ?>" id="add_time_to" name="add_time_to" class="pick_date" />
    <select name="pagenum">
      <option value="20" <?php if ($this->_var['pagenum'] == 20): ?>selected<?php endif; ?>>每页20条</option>
      <option value="50" <?php if ($this->_var['pagenum'] == 50): ?>selected<?php endif; ?>>每页50条</option>
      <option value="100" <?php if ($this->_var['pagenum'] == 100): ?>selected<?php endif; ?>>每页100条</option>
      <option value="150" <?php if ($this->_var['pagenum'] == 150): ?>selected<?php endif; ?>>每页150条</option>
      <option value="200" <?php if ($this->_var['pagenum'] == 200): ?>selected<?php endif; ?>>每页200条</option>
   </select>
    <input type="submit" class="formbtn" value="查询" />
</div>
</form>
    </div>
    <div class="fontr"><?php echo $this->fetch('page.top.html'); ?></div>
</div>

<form action="" method="post" id="form_post" target="_blank">
<div class="tdare">
<table width="100%" cellspacing="0" class="dataTable">
    <tr class="tatr1">
      <td width="15" class="firstCell"><input type="checkbox" class="checkall" /></td>
        <td><span ectype="order_by" fieldname="yubao_id">编号</span></td>
        <td>包裹预报运单号</td>
        <td><span ectype="order_by" fieldname="status">运单状态</span></td>
        <td><span ectype="order_by" fieldname="notes">备注</span></td>
        <td width="220">物品名称</td>
        <td>数量</td>
        <td><span ectype="order_by" fieldname="GoodsWorth">物品价值</span></td>
        <td><span ectype="order_by" fieldname="GoodsWeight">物品重量</span></td>
        <td>下单用户</td>
        <td>到货仓库</td>
        <td>库存位置</td>
        <td>库存天数</td>
        <td><span ectype="order_by" fieldname="rukutime">入库日期</span></td>
        <td><span ectype="order_by" fieldname="addtime">提交日期</span></td>        
        <td>操作</td>
    </tr>
    <?php $_from = $this->_var['lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
    <tr class="tatr2">
      <td class="firstCell"><input type="checkbox" class="checkitem" value="<?php echo $this->_var['list']['yubao_id']; ?>" /></td>
        <td class="left_style"><a href="index.php?app=kd_yubao&act=edit&id=<?php echo $this->_var['list']['yubao_id']; ?>"><?php echo htmlspecialchars($this->_var['list']['yubao_id']); ?></a></td>
        <td><?php echo htmlspecialchars($this->_var['list']['PostOfficeID']); ?>:<?php echo htmlspecialchars($this->_var['list']['yundanhao']); ?></td>
        <td><?php if ($this->_var['list']['status'] == '0'): ?><font color="#f00">未入库</font>
        <?php elseif ($this->_var['list']['status'] == '1'): ?><font color="#009966">已入库</font>
        <?php elseif ($this->_var['list']['status'] == '2'): ?><font color="#FF9900">已发出</font>
        <?php elseif ($this->_var['list']['status'] == '3'): ?><font color="#3399CC">转仓件</font>
        <?php elseif ($this->_var['list']['status'] == '4'): ?><font color="#00f">问题件</font>
        <?php elseif ($this->_var['list']['status'] == '5'): ?><font color="#FF00FF">待认领</font>
        <?php elseif ($this->_var['list']['status'] == '6'): ?><font color="#999">已取消</font>
        <?php endif; ?></td>
        <td><?php if ($this->_var['list']['notes']): ?><a href="javascript:void(0)" class="vtip" title="客户说：<?php echo $this->_var['list']['notes']; ?>"><img src="templates/style/images/tip_has.gif" width="14" height="13" /></a><?php endif; ?>&nbsp;
        <?php if ($this->_var['list']['admin_genzong']): ?><a href="javascript:void(0)" class="vtip" title="<?php echo $this->_var['list']['admin_genzong']; ?>"><img src="templates/style/images/tip_no.gif" width="14" height="13" /></a><?php endif; ?></td>
        <td width="220"><?php echo $this->_var['list']['GoodsName']; ?></td>
        <td><?php echo $this->_var['list']['GoodsCount']; ?></td>
        <td><strong class="bhong"><?php echo price_format($this->_var['list']['GoodsWorth']); ?></strong></td>
        <td><strong class="bhong"><?php echo $this->_var['list']['GoodsWeight']; ?></strong> LB</td>
        <td><?php if ($this->_var['list']['user_id']): ?><a href="index.php?app=user&act=index&key=<?php echo htmlspecialchars($this->_var['list']['user_name']); ?>" target="_blank"><?php echo htmlspecialchars($this->_var['list']['user_name']); ?></a><?php else: ?><?php echo htmlspecialchars($this->_var['list']['user_name']); ?><?php endif; ?></td>
        <td><?php echo $this->_var['list']['cangku']; ?></td>
        <td><?php echo ($this->_var['list']['CangkuWeizhi'] == '') ? '-' : $this->_var['list']['CangkuWeizhi']; ?></td>
        <td><?php echo $this->_var['list']['KuCunDay']; ?>天</td>
        <td><?php if ($this->_var['list']['rukutime']): ?><?php echo local_date("Y-m-d H:i:s",$this->_var['list']['rukutime']); ?><?php else: ?>-<?php endif; ?></td>        
        <td><?php echo local_date("Y-m-d H:i:s",$this->_var['list']['addtime']); ?></td>
        <td><a href="index.php?app=kd_yubao&act=edit&id=<?php echo $this->_var['list']['yubao_id']; ?>">编辑</a>
        </td>
  </tr>
  <?php endforeach; else: ?>
</table>
<table width="100%" cellspacing="0" class="dataTable">
  <tr bgcolor="#FFFFFF">
    <td style="padding:8px; color:#F00; text-align:center; font-size:14px;">没有符合条件的记录</td>
  </tr>
  <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
</table>
<div>
<?php if ($this->_var['lists']): ?>
<div id="dataFuncs">
  <div id="batchAction" class="left paddingT15">
   &nbsp;&nbsp;&nbsp;<label><input type="checkbox" class="checkall" /> 全选</label>&nbsp;&nbsp;
  <input class="formbtn batchButton" type="button" value="删除" name="id" uri="index.php?app=kd_yubao&act=drop" presubmit="confirm('确定要删除当前预报项吗（重要提醒：如果删除当前记录，将可能导致会员无法预报，或无法入库新增包裹！');" />  
  </div>
  <div class="pageLinks"><?php echo $this->fetch('page.bottom.html'); ?></div>
<?php endif; ?>

 </div>
  <div class="clear"></div>
</div>
</div>
</form>
<?php echo $this->fetch('footer.html'); ?>